
/*
包含n个接口请求函数的模块
函数的返回值: promise对象
 */
import ajax from './ajax'
const BASE_URL = 'http://192.168.1.166:8087/api'
// const BASE_URL = 'http://192.168.1.146:8087/api'

// const BASE_URL = '/api'

// 1、获取鱼缸详情
export const getDetail = (fishTankId) => ajax(`${BASE_URL}/fishTankDetail/getFishTankDetail?fishTankId=${fishTankId}`)
// 2、获取鱼缸详情展开部分
export const getDetailCon = (fishTankId) => ajax(`${BASE_URL}/fishTankDetail/getFishTankOtherDetail?fishTankId=${fishTankId}`)
// 3、获取四个报表
export const geReport = (data) => {
  return ajax(`${BASE_URL}/fishTankReport/getReportList`, data, 'post')
}
// 4·添加巡查报表
export const addPatrolReport = (data) => {
  return ajax(`${BASE_URL}/fishTankReport/addPatrolReport`, data, 'post')
}
// 添加喂食报表
export const addFeedReport = (data) => {
  return ajax(`${BASE_URL}/fishTankReport/addFeedReport`, data, 'post')
}
// 添加操作报表
export const addOperationReport = (data) => {
  return ajax(`${BASE_URL}/fishTankReport/addOperationReport`, data, 'post')
}
// 添加生物报表
export const addBiologyReport = (data) => {
  return ajax(`${BASE_URL}/fishTankReport/addBiologyReport`, data, 'post')
}
// 5.
export const getBiologyListByFishTankId = (fishTankId) => {
  return ajax(`${BASE_URL}/fishTankReport/getBiologyListByFishTankId?fishTankId=${fishTankId}`)
}

// 6.获取饲料列表
export const getFodderByFishTankId = (fishTankId) => {
  return ajax(`${BASE_URL}/fishTankReport/getFodderByFishTankId?fishTankId=${fishTankId}`)
}
// 7.获取操作列表
export const getFishTankOperation = (fishTankId) => {
  return ajax(`${BASE_URL}/fishTankReport/getFishTankOperation`)
}
// 8.根据鱼缸id获取生物数量
export const getBiologyNumByFishTankId = (fishTankId) => {
  return ajax(`${BASE_URL}/fishTankReport/getBiologyNumByFishTankId?fishTankId=${fishTankId}`)
}
// 9.获取生物操作列表
export const getBiologyOperation = (fishTankId) => {
  return ajax(`${BASE_URL}/fishTankReport/getBiologyOperation`)
}
// 10设备列表 主页
export const getEquipmentList = (page, pageSize, EqumientTypeId, keyword) => {
  return ajax(`${BASE_URL}/equipment/getEquipmentList?page=${page}&pageSize=${pageSize}&EqumientTypeId=${EqumientTypeId}&keyword=${keyword}`)
}
// 11设备类型列表
export const equipmentTypeList = () => {
  return ajax(`${BASE_URL}/equipment/equipmentTypeList`)
}
// 12修改设备状态
export const updateEquipmentTask = (data) => {
  return ajax(`${BASE_URL}/equipment/updateEquipmentTask`, data, 'post')
}
// 13根据ID返回单个设备信息
export const getEquipment = (equipmentId) => {
  return ajax(`${BASE_URL}/equipment/getEquipment?equipmentId=${equipmentId}`)
}
// 14根据传入的时间，获取所有设备信息
export const getReportFormListLb = (data) => {
  return ajax(`${BASE_URL}/equipment/getReportFormListLb`, data, 'post')
}
// 15提交没有保存
export const saveEquipmentListLb = (data) => {
  return ajax(`${BASE_URL}/equipment/saveEquipmentListLb`, data, 'post')
}
// ----------------------------------------实验室接口
// 1.提交没有保存
export const getLaboratoryList = () => {
  return ajax(`${BASE_URL}/laboratory/getLaboratoryList`)
}
// 2.获得药品列表及库存
export const getMedictionList = () => {
  return ajax(`${BASE_URL}/medictionReport/getMedictionList`)
}
// 3.日常用药统计报表
export const getMedictionReportList = (data) => {
  return ajax(`${BASE_URL}/medictionReport/getMedictionReportList`, data, 'post')
}
// 4.通过报表id获得报表详情
export const getReportById = (id, reportTypeId) => {
  return ajax(`${BASE_URL}/report/getReportById?id=${id}&reportTypeId=${reportTypeId}`)
}
// 5.获得药品操作列表
export const getMedictionOperation = () => {
  return ajax(`${BASE_URL}/medictionReport/getMedictionOperation`)
}
// 6.添加日常药品统计报表
export const addMedictionReport = (data) => {
  return ajax(`${BASE_URL}/medictionReport/addMedictionReport`, data, 'post')
}
// 7药品盘库列表
export const getMedictionCheckReportList = (data) => {
  return ajax(`${BASE_URL}/medictionReport/getMedictionCheckReportList`, data, 'post')
}
// 8添加药品盘库
export const addMedictionCheckReport = (data) => {
  return ajax(`${BASE_URL}/medictionReport/addMedictionCheckReport`, data, 'post')
}
// 9获得鱼缸列表
export const getFishTankSearchList = (keyword) => {
  return ajax(`${BASE_URL}/fishTank/getFishTankSearchList?keyword=${keyword}`)
}
// 10获得指标头
export const getIndicators = () => {
  return ajax(`${BASE_URL}/waterMonitoring/getIndicators`)
}
// 11根据id获得指标报表列表
export const getIndicatorReportByFishTankId = (data) => {
  return ajax(`${BASE_URL}/waterMonitoring/getIndicatorReportByFishTankId`, data, 'post')
}
// 12获得当天指标报表
export const getTodayIndicatorReport = (data) => {
  return ajax(`${BASE_URL}/waterMonitoring/getTodayIndicatorReport`, data, 'post')
}
// 13添加当天指标报表
export const addIndicatorReport = (data) => {
  return ajax(`${BASE_URL}/waterMonitoring/addIndicatorReport`, data, 'post')
}
// 实验室---饲料接口
// 1.饲料类型和个数
export const getStock = () => {
  return ajax(`${BASE_URL}/fodder/getStock`)
}
// 2.获取饲料列表
export const getFodderList = (data) => {
  return ajax(`${BASE_URL}/fodder/getFodderLists`,data, 'post')
}
// 3.盘库列表
export const getStockLists = (data) => {
  return ajax(`${BASE_URL}/fodder/getStockLists`,data, 'post')
}
// 实验室---生物接口
// 1.获取死亡生物列表
export const getBiologyReportList = (data) => {
  return ajax(`${BASE_URL}/biology/getBiologyReportList`,data, 'post')
}
//2.异常生物列表
export const getUnusualbiologyList = (data) => {
  return ajax(`${BASE_URL}/biology/getUnusualbiologyList`,data, 'post')
}
// 3.获取生物名称列表
export const getBiologyList = (data) => {
  return ajax(`${BASE_URL}/biology/getBiologyList`)
}
// 4. 获取生物死亡类型列表
export const getDeathTypeList = (data) => {
  return ajax(`${BASE_URL}/biology/getDeathTypeList`)
}
// 5.创建生物死亡报表
export const insertBiologyStatisticsReport = (data) => {
  return ajax(`${BASE_URL}/biology/insertBiologyStatisticsReport`,data, 'post')
}
// 6.获取生物库存
export const getBiologyStockById = (id) => {
  return ajax(`${BASE_URL}/biology/getBiologyStockById?id=${id}`)
}
// 8.生物盘库保存和添加
export const inertBiology = (data) => {
  return ajax(`${BASE_URL}/biology/inertBiology`,data, 'post')
}
// 9.获取生物盘库列表
export const getBiologyStock = (data) => {
  return ajax(`${BASE_URL}/biology/getBiologyStock`,data, 'post')
}
// 10.异常报表添加
export const updateFile = (data) => {
  return ajax(`${BASE_URL}/biology/updateFile`,data, 'post')
}
// 实验室--值班交接
// 1.获得值班交接列表
export const getDutyList = (data) => {
  return ajax(`${BASE_URL}/dutyReport/getDutyList`,data, 'post')
}
//2.获取今日值班交接
export const getTodayReport = () => {
  return ajax(`${BASE_URL}/dutyReport/getTodayReport`)
}
//用户登录
export const logo = (code) => {
  return ajax(`${BASE_URL}/user/login?code=${code}`)
}
export const logo2 = () => {
  return ajax(`${BASE_URL}/user/login2?username=admin&password=Ocean%252019!`)
}
//用户信息
export const getUserAllInfo = (data) => {
  return ajax(`${BASE_URL}/user/getUserAllInfo`)
}

//草稿箱
export const getAllDraft = (data) => {
  return ajax(`${BASE_URL}/user/draft/getAllDraft`)
}
//待办事务
export const getUserAllTask = (data) => {
  return ajax(`${BASE_URL}/user/getUserAllTask`)
}

//待办事务
export const getAllCompleteTask = (data) => {
  return ajax(`${BASE_URL}/user/getAllCompleteTask`)
}

//规章制度
export const getAllReformation = (data) => {
  return ajax(`${BASE_URL}/user/getAllReformation`)
}

//修改个人信息
export const updateUserInfo = (data) => {
  return ajax(`${BASE_URL}/user/updateUserInfo`,data,'post')
}
//上传头像
export const updateAvater = (data) => {
  return ajax(`${BASE_URL}/user/updateAvater`,data,'post')
}